define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'live.live/index',
        add_url: 'live.live/add',
        edit_url: 'live.live/edit',
        delete_url: 'live.live/delete',
        export_url: 'live.live/export',
        modify_url: 'live.live/modify',
        live_url:'live.live/live'
    };




    var operat = ['edit','delete','live']

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', search:false,title: 'id'},
                    {field: 'title', title: '直播标题'},
                    {field: 'live_master',search:false, title: '主播昵称',templet: function (res) {
                            return res.hosts.name
                        }},
                    {field: 'live_no', title: '房间号'},
                    {field: 'desc', search:false,title: '房间描述'},
                    {field: 'live_img', search:false,title: '房间封面图片',templet:ea.table.image},
                    {field: 'status', search:false,title: '直播状态', templet: ea.table.switch},
                    {field: 'sort', search:false,title: '直播排序', edit: 'text'},
                    {width: 250, title: '操作', templet: ea.table.recycleTool,operat},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});